home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / READPOST.H < prev    next >
Text File  |  1988-05-30  |  2KB  |  60 lines

  1. /* -*-C-*- readpost.h */
  2. /*-->readpost*/
  3. /**********************************************************************/
  4. /****************************** readpost ******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. readpost()
  9.  
  10. /***********************************************************************
  11. This routine is used  to read in the  postamble values.  It  initializes
  12. the magnification and checks the stack height prior to starting printing
  13. the document.
  14. ***********************************************************************/
  15.  
  16. {
  17.     long lastpageptr;        /* byte pointer to last physical page */
  18.     int the_page_count;        /* page count from DVI file */
  19.  
  20.     findpost();
  21.     if ((BYTE)nosignex(dvifp,(BYTE)1) != POST)
  22.     (void)fatal("readpost():  POST missing at head of postamble");
  23.  
  24.     lastpageptr = (long)nosignex(dvifp,(BYTE)4);
  25.     num = nosignex(dvifp,(BYTE)4);
  26.     den = nosignex(dvifp,(BYTE)4);
  27.     mag = nosignex(dvifp,(BYTE)4);
  28.     conv = ((float)num/(float)den) *
  29.        ((float)runmag/(float)STDMAG) *
  30.  
  31. #if    USEGLOBALMAG
  32.         actfact(mag) *
  33. #endif
  34.  
  35.         ((float)RESOLUTION/254000.0);
  36.     /* denominator/numerator here since will be dividing by the conversion
  37.        factor */
  38.     (void) nosignex(dvifp,(BYTE)4);    /* height-plus-depth of tallest page */
  39.     (void) nosignex(dvifp,(BYTE)4);    /* width of widest page */
  40.     if ((int)nosignex(dvifp,(BYTE)2) >= STACKSIZE)
  41.     (void)fatal("readpost():  Stack size is too small");
  42.  
  43.     the_page_count = (int)nosignex(dvifp,(BYTE)2);
  44.  
  45.     if (!quiet)
  46.     {
  47.     (void)fprintf(stderr,"[%d pages]",the_page_count);
  48.     NEWLINE(stderr);
  49.  
  50.     (void)fprintf(stderr,"[%d magnification]",(int)runmag);
  51.     NEWLINE(stderr);
  52.     }
  53.  
  54.     if (preload)
  55.         getfntdf();
  56.     getpgtab(lastpageptr);
  57. }
  58.  
  59.  
  60.